package org.jsola.hr.dao;

import org.apache.ibatis.annotations.Param;
import org.jsola.hr.entity.AttendPunchRecordDO;
import org.jsola.hr.query.AttendPunchRecordQuery;
import org.jsola.hr.vo.AttendPunchRecordVO;
import org.jsola.orm.mapper.IJsolaMapper;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author zhr
 */
@Repository("hrAttendPunchRecordDAO")
public interface IAttendPunchRecordDAO extends IJsolaMapper<AttendPunchRecordDO> {

    /**
     * 查询某月的考勤列表
     * @param attendPunchRecordQuery 查询参数
     * @param siteId 站点id
     * @return 查询结果列表
     */
    List<AttendPunchRecordVO> selectAttendPunchRecord(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                      @Param(value = "siteId") String siteId);

    /**
     * 查询某个人某月的考勤合计
     * @param attendPunchRecordQuery 查询参数
     * @param empInfoId 员工id
     * @param siteId 站点id
     * @return 查询结果列表
     */
    List<AttendPunchRecordVO> selectLeaveEarly(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                               @Param(value = "empInfoId") String empInfoId, @Param(value = "siteId") String siteId);

    /**
     * 查询某个人某月的考勤记录
     * @param attendPunchRecordQuery
     * @param siteId
     * @return
     */
    List<AttendPunchRecordVO> selectAttendMonth(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                @Param(value = "siteId") String siteId);

    /**
     * 查询某个人某年某月的考勤记录
     * @param attendPunchRecordQuery
     * @param siteId
     * @return
     */
    List<AttendPunchRecordVO> selectAttendYearMonth(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                @Param(value = "siteId") String siteId);


    /**
     * 查询某个日的考勤记录（工作时长求和）
     * @param attendPunchRecordQuery
     * @param siteId
     * @return
     */
    List<AttendPunchRecordVO> selectAttendByDay(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                @Param(value = "siteId") String siteId);

    /**
     * 查询某个日的考勤记录（取最后一条工作时长）
     * @param attendPunchRecordQuery
     * @param siteId
     * @return
     */
    List<AttendPunchRecordVO> selectAttendByDayTwo(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                @Param(value = "siteId") String siteId);

    /**
     * 根据时间段查询考勤记录
     * @param attendPunchRecordQuery
     * @param siteId
     * @return
     */
    List<AttendPunchRecordVO> selectAttendByTime(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                @Param(value = "siteId") String siteId);



    /**
     * 查询某个日的考勤记录
     * @param attendPunchRecordQuery
     * @param siteId
     * @return
     */
    List<AttendPunchRecordVO> selectAttendByDayAndEmpId(@Param(value = "attendPunchRecordQuery") AttendPunchRecordQuery attendPunchRecordQuery,
                                                        @Param(value = "siteId") String siteId);

}

